/**
 * @Author:  renyc
 * @Date: 2023年2月22日09:06:14
 */
'use strict';

import WFSProvider from './WFSProvider';

export default class WFSProvider_1_1_0 extends WFSProvider{

    constructor(){
        super();
        this._version = "1.1.0";
    }

    get version(){
        return this._version;
    }

    /**
     * 编码GetFeature协议
     * @param {*} typeName 
     * @param {*} fields 
     * @param {*} filter 
     * @returns 
     */
    encodeGetFeature(typeName, fields, filter){
        let template  = this.getGetFeatureTemplate();
        let body = template.replace("{typeName}", typeName);

        return body;
    }

    /**
     * 获取GetFeature模板
     * @param {} query 
     */
    getGetFeatureTemplate(){
        let template = 
            "<wfs:GetFeature service=\"WFS\" version=\"1.1.0\" \
                outputFormat=\"application/json\" \
                xmlns:topp=\"http://www.openplans.org/topp\" \
                xmlns:wfs=\"http://www.opengis.net/wfs\" \
                xmlns:ogc=\"http://www.opengis.net/ogc\" \
                xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \
                xsi:schemaLocation=\"http://www.opengis.net/wfs \
                                    http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd\"> \
                <wfs:Query typeName=\"{typeName}\"> \
                </wfs:Query>  \
            </wfs:GetFeature>";

        return template;
    }

    
    
}